this._pointerInTray = false;
this._pointerInKeyboard = false;
this._summaryState = State.HIDDEN;
- this._summaryTimeoutId = 0;
this._pointerInSummary = false;
this._notificationState = State.HIDDEN;
this._notificationTimeoutId = 0;
Lang.bind(this, this.toggle));
this._summaryItems = [];
- // We keep a list of new summary items that were added to the summary since the last
- // time it was shown to the user. We automatically show the summary to the user if there
- // are items in this list once the notifications are done showing or once an item gets
- // added to the summary without a notification being shown.
- this._newSummaryItems = [];
this._chatSummaryItemsCount = 0;
},
this._summaryItems.push(summaryItem);
- // We keep this._newSummaryItems to track any new sources that were added to the
- // summary and show the summary with them to the user for a short period of time
- // after notifications are done showing. However, we don't want that to happen for
- // transient sources, which are removed after the notification is shown, but are
- // not removed fast enough because of the callbacks to avoid the summary popping up.
- // So we just don't add transient sources to this._newSummaryItems.
- // We don't want that to happen for chat sources neither, because they
- // can be added when the user starts a chat from Empathy and they are not transient.
- // The notification will popup on incoming message anyway. See bug #657249.
- if (!source.isTransient && !source.isChat)
- this._newSummaryItems.push(summaryItem);
-
source.connect('notify', Lang.bind(this, this._onNotify));
source.connect('muted-changed', Lang.bind(this,
let summaryItemToRemove = this._summaryItems[index];
- let newSummaryItemsIndex = this._newSummaryItems.indexOf(this._summaryItems[index]);
- if (newSummaryItemsIndex != -1)
- this._newSummaryItems.splice(newSummaryItemsIndex, 1);
-
this._summaryItems.splice(index, 1);
if (source.isChat)
if (status == GnomeSession.PresenceStatus.BUSY) {
// remove notification and allow the summary to be closed now
this._updateNotificationTimeout(0);
- this._unsetSummaryTimeout();
this._busy = true;
} else if (status != GnomeSession.PresenceStatus.IDLE) {
// We preserve the previous value of this._busy if the status turns to IDLE
this._pointerInTray = false;
this._pointerInSummary = false;
this._updateNotificationTimeout(0);
- this._unsetSummaryTimeout();
this._updateState();
}
return false;
this._pointerInTray = false;
this._pointerInSummary = false;
this._updateNotificationTimeout(0);
- this._unsetSummaryTimeout();
this._updateState();
},
// Summary
let summarySummoned = this._pointerInSummary || this._overviewVisible || this._traySummoned;
- let summaryPinned = this._summaryTimeoutId != 0 || this._pointerInTray || summarySummoned || this._locked;
+ let summaryPinned = this._pointerInTray || summarySummoned || this._locked;
let summaryHovered = this._pointerInTray || this._pointerInSummary;
let notificationsVisible = (this._notificationState == State.SHOWING ||
let mustHideSummary = (notificationsPending && (notificationUrgent || summaryOptionalInOverview))
|| notificationsVisible || this._isScreenLocked;
- if (this._summaryState == State.HIDDEN && !mustHideSummary) {
- if (summarySummoned) {
- this._showSummary(0);
- } else if (notificationsDone && !this._busy && !this._inFullscreen) {
- if (this._newSummaryItems.length > 0)
- this._showSummary(SUMMARY_TIMEOUT);
- }
- } else if (this._summaryState == State.SHOWN && (!summaryPinned || mustHideSummary))
+ if (this._summaryState == State.HIDDEN && !mustHideSummary && summarySummoned)
+ this._showSummary();
+ else if (this._summaryState == State.SHOWN && (!summaryPinned || mustHideSummary))
this._hideSummary();
// Summary notification
Lang.bind(this, this._notificationTimeout));
},
- _unsetSummaryTimeout: function(timeout) {
- if (this._summaryTimeoutId) {
- Mainloop.source_remove(this._summaryTimeoutId);
- this._summaryTimeoutId = 0;
- }
- },
-
_notificationTimeout: function() {
let [x, y, mods] = global.get_pointer();
if (y > this._lastSeenMouseY + 10 && !this.actor.hover) {
this._focusGrabber.grabFocus(this._notification.actor);
},
- _showSummary: function(timeout) {
- this._newSummaryItems = [];
+ _showSummary: function() {
this._summaryBin.opacity = 0;
this._summaryBin.y = this.actor.height;
this._tween(this._summaryBin, '_summaryState', State.SHOWN,
opacity: 255,
time: ANIMATION_TIME,
transition: 'easeOutQuad',
- onComplete: this._showSummaryCompleted,
- onCompleteScope: this,
- onCompleteParams: [timeout]
});
},
- _showSummaryCompleted: function(timeout) {
- this._newSummaryItems = [];
- if (timeout != 0) {
- this._summaryTimeoutId =
- Mainloop.timeout_add(timeout * 1000,
- Lang.bind(this, this._summaryTimeout));
- }
- },
-
- _summaryTimeout: function() {
- this._summaryTimeoutId = 0;
- this._updateState();
- return false;
- },
-
_hideSummary: function() {
this._tween(this._summaryBin, '_summaryState', State.HIDDEN,
{ opacity: 0,